load("@com_github_p4lang_p4c//:bazel/p4_library.bzl", "p4_graphs", "p4_library")

p4_library(
    name = "program",
    src = "program.p4",
    p4info_out = "program.p4info.txt",
    visibility = ["//:__subpackages__"],
    deps = ["empty.p4"],
)

p4_library(
    name = "program_with_more_options",
    src = "program.p4",
    arch = "v1model",  # Optional (default: "v1model").
    p4info_out = "program.p4info.2.txt",  # Optional.
    target = "bmv2",  # Optional (default: "bmv2").
    target_out = "program.bmv2.json",  # Optional.
    visibility = ["//:__subpackages__"],  # Optional.
    deps = ["empty.p4"],  # Optional: #include-ed dependencies.
)

p4_library(
    name = "vxlan_dpdk_pna",
    src = "vxlan.p4",
    arch = "pna",
    bf_rt_schema_out = "vxlan.bf-rt-schema",
    context_out = "vxlan.context",
    p4c_backend = "@com_github_p4lang_p4c//:p4c_dpdk",
    target = "dpdk",
    target_out = "vxlan.spec",
)

p4_graphs(
    name = "program_graphs",
    src = "program.p4",
    out = "program_graphs.dot",
    deps = ["empty.p4"],
)
